<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!-- 导入jstl标签库 -->
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>图书推荐首页</title>
<link rel="stylesheet" type="text/css" href="css/default.css" />
<link rel="stylesheet" type="text/css" href="css/common.css" />
<!--新添-->

        <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css" />
	    <link rel="stylesheet" type="text/css" href="css/bootstrap-responsive.min.css" />
	    <link rel="stylesheet" type="text/css" href="css/style.css" />
        <link rel="stylesheet" type="text/css" href="css/default2.css" />
        

<script type="text/javascript" src="js/jquery.min.js"></script>
<script src="js/kindeditor/kindeditor-min.js"	type="text/javascript"></script>
<script src="js/kindeditor/lang/zh_CN.js"	type="text/javascript"></script>
</head>
<body>
	<div class="header">
		<table width="100%">
			<tr>
				<td width="500" style="padding-top:16px">
					<img src="images/book.png" />
					<img src="images/a.gif" />
				</td>
				<td align="right">
					<div class="box">
						<div class="demo" style="text-align:right;margin-top:50px;">
						<c:if test="${loginUser == null}">
							 <a href="javascript:" id="login" style="font-weight:bold"> <img src="images/login-24.gif" title="登录" /> </a>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
							 <a href="/booksRecommend/RegistUser"> <img src="images/login-25.gif" title="注册" /></a>  </c:if>
						<c:if test="${loginUser != null}">欢迎你 ！${loginUser} <a href="/booksRecommend/logout" >注销</a></c:if>
						</div>
						<div id="dialogBg"></div>
						<div id="dialog" class="animated">
							<img class="dialogIco" width="50" height="40" src="images/ico.png" />
							<div class="dialogTop">
								<a href="javascript:;" class="closeDialogBtn">关闭</a>
							</div>
							<form action="/booksRecommend/LoginServlet" method="post">
								<ul class="editInfos">
									<li>昵&nbsp;&nbsp;&nbsp;称：<input type="text" id="username" name="username" class="ipt" /></li>
									<li>密&nbsp;&nbsp;&nbsp;码：<input type="text" id="password" name="password" class="ipt" /></li>
									<li><input type="submit" value="登录" class="submitBtn" /></li>
								</ul>
							</form>
						</div>
					</div>
				</td>
			</tr>
		</table>
	</div>
	<hr/>
	<!--公告和版面列表-->
	<div class="mainbox">

     <!--新添
        <div  style="text-align:left;">
         <a href="#reply"><img src="images/a.gif" /></a>&nbsp;
</div>-->
	   

		<div class="nav"    >
			<div style="float:left;">
				<img src="images/a.gif" />
				<a href="${pageContext.request.contextPath}/listArticles" style="font-size:30px;">图书推荐列表</a>
			</div>
		</div><br/>
		<table style="width:100%; margin-bottom: -5px;" cellSpacing="0" cellPadding="0">
			<tr style="text-align: left;">
				<td >
				<a href="/booksRecommend/publish"><img src="images/6.png" />
				<button type="submit" class="btn btn-primary">推荐图书</button></a>
					
				</td>
			</tr>
<!--新添-->
<div  style="text-align:right;font-size:20px;color:#099" >
           <form class="form-inline definewidth m20" action="" method="post" >
			图书查询:
            <input name="" class="abc input-default" value="" style="border:1px double #CCCCCC"></input>&nbsp;&nbsp;
			<button type="submit" class="btn btn-primary">查  询</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
		    <!--<button type="button" class="btn btn-primary" onclick="window.location.href='后台-用户管理-添加用户.html'">添加</button>&nbsp;&nbsp;--> 
		    <font color="red"></font>
		</form>
</div>
		</table>
		
   <c:forEach items="${recommendations}" var="recommendation">
		<table class="topic border" style="width:100%; border-bottom-color: currentColor; border-bottom-width: medium; border-bottom-style: none; margin-top:10px;" cellSpacing="0" cellPadding="0">
			<tr>
				<th colspan="5">
					<h1 style="float:left;">图书推荐平台 </h1>
					<span style="float:right">${recommendation.publishtime}   &nbsp;&nbsp;&nbsp;
					    <c:if test="${recommendation.state == 1}">   <span style="font-size:20px;font-family:黑体;color:#30F">&nbsp;已采纳 </span></c:if>
					    <c:if test="${recommendation.state != 1}">   <span style="font-size:20px;font-family:黑体;color:#30F">&nbsp;未采纳 </span></c:if>
					    </span>
				</th>
			</tr>
		</table>
		
		<!-- 主题帖子 -->
		<table class="bbslist border" style="width:100%; table-layout: fixed; word-break: break-all;" 
			cellSpacing="0" cellPadding="0">
			<tr>
				<td class="infoleft leftcolor" vAlign="top" rowSpan="3"><br>
					<span><img src="images/01.jpg" title="发布者">&nbsp;&nbsp;&nbsp;</span>
					<span style="float:left;font-size:16px;">${recommendation.referrer}</span>
				</td>
<!-- 图书图片 
               <td class="infoleft leftcolor" vAlign="top" rowSpan="3"><br>
					<span><img src="images/01.jpg" title="图书图片"></span>
				</td>-->

				<td style="line-height: 120%;" class="inforight" vAlign="top">
					<table cellSpacing="0" cellPadding="0">
						<tr>
							<td>
								<div style="text-indent: 24px; overflow: hidden; font-size: 9pt; word-break: break-all; word-wrap: break-word;" id="textstyle_1">
									<!--新添-->
									<br><span style="font-size:18px;font-weight:900;">图&nbsp;&nbsp;书</span>&nbsp;&nbsp;&nbsp; 
									         <span style="font-size:20px;font-family:楷体;color:red">&nbsp;《${recommendation.booksname}》 </span><br>
									<span style="font-size:18px;font-weight:900;">作&nbsp;&nbsp;者</span> 
									         <span style="font-size:16px;font-family:楷体;">&nbsp;&nbsp;&nbsp;${recommendation.author} </span><br>
									<span style="font-size:18px;font-weight:900;">出版社</span>
									          <span style="font-size:16px;font-family:楷体;">&nbsp;&nbsp;${recommendation.press}</span><br>
									<span  style="font-size:18px;font-weight:900;">图书类型</span>
									         <span style="font-size:16px;font-family:楷体;">&nbsp;&nbsp;${recommendation.bookstype}</span><br>
									<span style="font-size:18px;font-weight:900;">图书简介</span>
									         <span style="font-size:16px;font-family:楷体;">&nbsp;&nbsp;${recommendation.recommendation}</span>
				
								</div>
							</td>
						</tr>
					</table><br>
				</td>
			</tr>
		</table>
	</c:forEach>


	</div>
	<!---------------end 底部友情链接部分------------------->
	<div class="copyright">
		<span style="text-align:center;">Copyright &copy;2017 - 2020
			&nbsp;&nbsp;&nbsp;Powered By 桂林电子科技大学  <a href="" target="_blank">Version 1.0.0</a></span>
	</div>
</body>	
</html>
<script type="text/javascript">
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
			resizeType : 1,
			allowPreviewEmoticons : false,
			allowImageUpload : false,
			items : [ 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor',
					'bold', 'italic', 'underline', 'removeformat', '|',
					'justifyleft', 'justifycenter', 'justifyright',
					'insertorderedlist', 'insertunorderedlist', '|',
					'link' ],
			afterCreate : function() {
				this.sync();
			},
			afterBlur : function() {
				this.sync();
			}
		});
	});
	
	var w,h,className;
	function getSrceenWH(){
		w = $(window).width();
		h = $(window).height();
		$('#dialogBg').width(w).height(h);
	}
	
	window.onresize = function(){  
		getSrceenWH();
	}  
	$(window).resize();  
	
	$(function(){
		getSrceenWH();
		
		//显示弹框
		$('.box #login').click(function(){
			className = $(this).attr('class');
			$('#dialogBg').fadeIn(300);
			$('#dialog').removeAttr('class').addClass('animated '+className+'').fadeIn();
			$('#userName').focus();
		});
		
		//关闭弹窗
		$('.closeDialogBtn').click(function(){
			$('#dialogBg').fadeOut(300,function(){
				$('#dialog').addClass('bounceOutUp').fadeOut();
			});
		});
	});
</script>
